﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;
using Web.UI;
namespace Web.frontpage.SignUp.right
{
    public partial class Infor : SignUpPage
    {
        public BoStudents model = new BoStudents();
        BLL.StudentService studentservice = new BLL.StudentService();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["studentId"] != null)
                {
                    model = studentservice.GetV_Student(Session["studentId"].ToString());
                    if (model != null)
                    {
                        lb_code.InnerText = model.STU_CODE;
                        lb_class.InnerText = model.classes.CLA_NAME;
                        lb_academy.InnerText = model.academy.ACA_NAME;
                        lb_gender.InnerText = model.STU_GENDER == "1" ? "男" : "女";
                        lb_grade.InnerText = model.STU_GRADE.ToString();
                        lb_name.InnerText = model.STU_NAME;
                        Rp_contestBind();
                    }
                }
                else
                    Response.Write("<script>alert('对不起，你没有登录');parent.location.href='../login.aspx';</script>");
            }
        }
        /// <summary>
        /// 绑定Rp_contest控件
        /// </summary>
        protected void Rp_contestBind()
        {
            DateTime time = DateTime.Now;
            string constr = "PAR_STUDENTS ='" + Session["studentId"] + "' and  CON_ENDTIME < '" + time + "'";
            Rp_contest.DataSource = studentservice.Getv_StudentToContest(constr);
            Rp_contest.DataBind();
        }
    }
}